# gatekeeper

_Bash script for quickly connecting to VPN Gate's free VPN_

Plain, simple script to connect to the free VPN service [VPN Gate](https://vpngate.net). It works with basic tools which are commonly available on any system. Doesn't even require network-manager.

## Usage

```sh
git clone --depth 1 https://notabug.org/adnan360/gatekeeper.git
cd gatekeeper
./fetch.sh
./connect.sh
```

Press Ctrl+C when you want to disconnect.

## Configure

Configuration is optional.

```sh
cp -i config.sample.sh config.sh
$EDITOR config.sh
```

### Scripts

You can run custom scripts when vpn is connected or disconnected. This is handy for customization, firewall tightening etc. Possibilities are endless. Create `up.sh` and `down.sh` right inside `data` directory, make them executable.

`data/up.sh`
```sh
#!/usr/bin/env bash
echo 'UPPP!!!'
```

`data/down.sh`
```sh
#!/usr/bin/env bash
echo 'DOWNNN!!!'
```

Now connect and disconnect to see if the above messages appear. You can use contents created inside `run` directory to use in these scripts if you need it.

- `vpn_device`: stores the device through which VPN is connected. e.g. `tun0`
- `vpn_ip`: stores the remote ip that is connected to.
- `vpn_port`: stores the remote port that is connected to.

## Requirements

- bash
- curl or wget
- base64
- openvpn

## License

GPLv2
